package stack;

public class StackIterator<Template> {
	private final Stack<Template> thisStack;
	private int index = 0;
	
	public StackIterator(Stack<Template> passedStack)
	{
		thisStack = passedStack;
	}
	
	public boolean hasNext()
	{
		if (index<thisStack.size()) return true; else return false;
	}
	
	public Template next()
	{
		return thisStack.get(index++);
	}
	public Template returnNext()
	{
		return thisStack.get(index);
	}
	
}
